package cn.tedu._03vehicle.pojo.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.*;
import lombok.Data;

@Data
public class UserRegParam {
    //@NotNull(message = "用户名不能为null")
    //@NotEmpty(message = "用户名不能为空")
    //@NotBlank(message = "用户名不能为null和空字符串和空白串")
    @Size(min = 3, max = 10, message = "用户名长度必须在3到10之间")
    @Schema(description = "用户名", required = true, example = "admin")
    private String username;
    @Pattern(regexp = "^(?![0-9])(?!(?:[a-zA-Z]{11,})|(?:[0-9]{8,}))(?:[a-zA-Z0-9]{1,10})$",
            message = "用户名最长为10个英文或7个数字，且不能以数字开头")
    @Schema(description = "密码", required = true, example = "123456")
    private String password;
    //@Email(message = "邮箱格式错误")
    @Schema(description = "邮箱", required = true, example = "admin@163.com")
    private String email;
    @Pattern(regexp = "^1[3-9]\\d{9}$",
            message = "请输入有效的11位中国手机号")
    @Schema(description = "手机号码", required = true, example = "13800000000")
    private String phone;
}
